using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace MicroMsg.UI.UserContrl
{
	public static class EnumerableExtensions
	{
		public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> collection)
		{
			ObservableCollection<T> observableCollection = new ObservableCollection<T>();
			using (IEnumerator<T> enumerator = collection.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					T current = enumerator.get_Current();
					observableCollection.Add(current);
				}
			}
			return observableCollection;
		}
	}
}
